
package Presentacion;

import Dominio.CaracteresInvalidos;
import Dominio.ControladorRanking;
import Dominio.ControladorUsuario;
import Datos.GestorUsuarios;
import Dominio.Humano;
import Dominio.Ranking;
import Dominio.UsuariExistent;
import Dominio.UsuariInexistent;
import javax.swing.JOptionPane;

/**
 *
 * @author Victor Varias Perez
 * Cluster y grupo: C8G3
 * Creado el 18-abr-2010 17:19:03
 *
 * Objetivo de la clase: Capa de presentación
 * Clases utilizadas: Carta, Mazo, Jugador
 */
public class gui extends javax.swing.JFrame {

    /**
     * Atributo que guarda el panel dónde debemos ir despues de hacer login
     */
    protected static javax.swing.JPanel nextpane = new javax.swing.JPanel();
    /**
     * Atributo que guarda el panel anterior al hacer login
     */
    protected static javax.swing.JPanel previouspane = new javax.swing.JPanel();
    /**
     * Atributo que guarda el panel dónde debemos ir despues de hacer registrar
     */
    protected static javax.swing.JPanel nextpanereg = new javax.swing.JPanel();
    /**
     * Atributo que guarda el panel anterior al hacer registrar
     */
    protected static javax.swing.JPanel previouspanereg = new javax.swing.JPanel();
    /**
     * Atributo que guarda la cantidad maxima de jugadores que pueden jugar
     */
    int nmaxjug = 7;
    /**
     * Atributo que guarda el usuario actual
     */
    Humano usuarioactual;

    /** Creates new form gui */
    public gui() {
        initComponents();
        getRootPane().setContentPane(IntroGui);
    }

    /**
     * Operacion que establece el numero maximo de jugadores
     * @param i numero maximo de jugadores
     */
    public void Setnmaxjug(int i) {
        nmaxjug = i;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        IntroGui = new javax.swing.JPanel();
        NuevaPartida = new javax.swing.JButton();
        Bienvenido = new javax.swing.JLabel();
        CargarPartida = new javax.swing.JButton();
        Usuario = new javax.swing.JButton();
        Registrar = new javax.swing.JButton();
        Ranking = new javax.swing.JButton();
        Ayuda = new javax.swing.JButton();
        LoginGui = new javax.swing.JPanel();
        user = new javax.swing.JTextField();
        registrar = new javax.swing.JButton();
        aceptar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        cancelar = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        pass = new javax.swing.JTextField();
        incorrecto = new javax.swing.JLabel();
        AyudaGui = new javax.swing.JPanel();
        LabelAyuda = new javax.swing.JLabel();
        Volver = new javax.swing.JButton();
        RankingGui = new javax.swing.JPanel();
        VolverRanking = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        usuario1 = new javax.swing.JLabel();
        usuario2 = new javax.swing.JLabel();
        usuario3 = new javax.swing.JLabel();
        usuario4 = new javax.swing.JLabel();
        usuario5 = new javax.swing.JLabel();
        usuario6 = new javax.swing.JLabel();
        usuario7 = new javax.swing.JLabel();
        usuario8 = new javax.swing.JLabel();
        usuario9 = new javax.swing.JLabel();
        usuario10 = new javax.swing.JLabel();
        punt1 = new javax.swing.JLabel();
        punt2 = new javax.swing.JLabel();
        punt3 = new javax.swing.JLabel();
        punt4 = new javax.swing.JLabel();
        punt5 = new javax.swing.JLabel();
        punt6 = new javax.swing.JLabel();
        punt7 = new javax.swing.JLabel();
        punt8 = new javax.swing.JLabel();
        punt9 = new javax.swing.JLabel();
        punt10 = new javax.swing.JLabel();
        norank = new javax.swing.JLabel();
        SelJugGui = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        NJug = new javax.swing.JComboBox();
        aceptarJugadores = new javax.swing.JButton();
        jug1 = new javax.swing.JLabel();
        jug11 = new javax.swing.JComboBox();
        jug12 = new javax.swing.JComboBox();
        jug5 = new javax.swing.JLabel();
        jug51 = new javax.swing.JComboBox();
        jug52 = new javax.swing.JComboBox();
        jug2 = new javax.swing.JLabel();
        jug21 = new javax.swing.JComboBox();
        jug22 = new javax.swing.JComboBox();
        jug6 = new javax.swing.JLabel();
        jug61 = new javax.swing.JComboBox();
        jug62 = new javax.swing.JComboBox();
        jug3 = new javax.swing.JLabel();
        jug31 = new javax.swing.JComboBox();
        jug32 = new javax.swing.JComboBox();
        jug7 = new javax.swing.JLabel();
        jug71 = new javax.swing.JComboBox();
        jug72 = new javax.swing.JComboBox();
        jug4 = new javax.swing.JLabel();
        jug41 = new javax.swing.JComboBox();
        jug42 = new javax.swing.JComboBox();
        PartidaGui = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        RegistrarGui = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        nombreusuarionuevo = new javax.swing.JTextField();
        contraseñausuarionuevo = new javax.swing.JTextField();
        existente = new javax.swing.JLabel();
        aceptaralta = new javax.swing.JButton();
        Cancelaralta = new javax.swing.JButton();
        UsuarioGui = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        Usuarionombre = new javax.swing.JTextField();
        jtext = new javax.swing.JLabel();
        Usuariocontraseña = new javax.swing.JTextField();
        Usuarioaceptar = new javax.swing.JButton();
        Uauariocancelar = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        Usuariocontraseñanueva = new javax.swing.JTextField();
        CargarPartidaGui = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        partidaacargar = new javax.swing.JComboBox();
        cargaraceptar = new javax.swing.JButton();
        cargarcancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        NuevaPartida.setText("Nueva Partida");
        NuevaPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NuevaPartidaActionPerformed(evt);
            }
        });

        Bienvenido.setFont(new java.awt.Font("Tahoma", 0, 14));
        Bienvenido.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        Bienvenido.setText("Bienvenido! escoje la opción que prefieras");

        CargarPartida.setText("Cargar Partida");
        CargarPartida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CargarPartidaActionPerformed(evt);
            }
        });

        Usuario.setText("Usuario");
        Usuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UsuarioActionPerformed(evt);
            }
        });

        Registrar.setText("Registrar");
        Registrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RegistrarActionPerformed(evt);
            }
        });

        Ranking.setText("Ranking");
        Ranking.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RankingActionPerformed(evt);
            }
        });

        Ayuda.setText("Ayuda");
        Ayuda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AyudaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout IntroGuiLayout = new javax.swing.GroupLayout(IntroGui);
        IntroGui.setLayout(IntroGuiLayout);
        IntroGuiLayout.setHorizontalGroup(
            IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(IntroGuiLayout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addGroup(IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Bienvenido)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, IntroGuiLayout.createSequentialGroup()
                        .addGroup(IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(Ranking, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(Usuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(NuevaPartida, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)
                        .addGroup(IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(Ayuda, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(Registrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(CargarPartida, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap(313, Short.MAX_VALUE))
        );
        IntroGuiLayout.setVerticalGroup(
            IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(IntroGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(Bienvenido)
                .addGap(18, 18, 18)
                .addGroup(IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NuevaPartida)
                    .addComponent(CargarPartida))
                .addGap(18, 18, 18)
                .addGroup(IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Usuario)
                    .addComponent(Registrar))
                .addGap(18, 18, 18)
                .addGroup(IntroGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Ranking)
                    .addComponent(Ayuda))
                .addContainerGap(290, Short.MAX_VALUE))
        );

        registrar.setText("Registrar");
        registrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                registrarActionPerformed(evt);
            }
        });

        aceptar.setText("Aceptar");
        aceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel1.setText("Por favor, introduce tu nombre de usuario y password");

        jLabel2.setText("Si no estás registrado puedes hacerlo pulsando el botón registrar");

        jLabel3.setText("Usuario:");

        jLabel4.setText("Password:");

        cancelar.setText("Cancelar");
        cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelarActionPerformed(evt);
            }
        });

        incorrecto.setFont(new java.awt.Font("Tahoma", 0, 14));
        incorrecto.setText("Los datos introducidos son incorrectos");

        javax.swing.GroupLayout LoginGuiLayout = new javax.swing.GroupLayout(LoginGui);
        LoginGui.setLayout(LoginGuiLayout);
        LoginGuiLayout.setHorizontalGroup(
            LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(LoginGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(LoginGuiLayout.createSequentialGroup()
                .addGap(48, 48, 48)
                .addComponent(jLabel2)
                .addContainerGap(97, Short.MAX_VALUE))
            .addGroup(LoginGuiLayout.createSequentialGroup()
                .addGap(163, 163, 163)
                .addComponent(registrar)
                .addContainerGap(217, Short.MAX_VALUE))
            .addGroup(LoginGuiLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(LoginGuiLayout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(LoginGuiLayout.createSequentialGroup()
                                .addComponent(aceptar, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                                .addGap(55, 55, 55)
                                .addComponent(cancelar, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, LoginGuiLayout.createSequentialGroup()
                                .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4))
                                .addGap(26, 26, 26)
                                .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(pass, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)
                                    .addComponent(user, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE)))
                            .addComponent(incorrecto, javax.swing.GroupLayout.Alignment.LEADING))
                        .addGap(81, 81, 81)))
                .addGap(44, 44, 44))
        );
        LoginGuiLayout.setVerticalGroup(
            LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, LoginGuiLayout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(LoginGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptar)
                    .addComponent(cancelar))
                .addGap(18, 18, 18)
                .addComponent(incorrecto)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(registrar)
                .addContainerGap())
        );

        LabelAyuda.setText("Aqui es dónde habrá la ayuda a nuestros juegos");

        Volver.setText("Volver");
        Volver.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                VolverActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout AyudaGuiLayout = new javax.swing.GroupLayout(AyudaGui);
        AyudaGui.setLayout(AyudaGuiLayout);
        AyudaGuiLayout.setHorizontalGroup(
            AyudaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AyudaGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(LabelAyuda, javax.swing.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Volver)
                .addContainerGap())
        );
        AyudaGuiLayout.setVerticalGroup(
            AyudaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(LabelAyuda, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, AyudaGuiLayout.createSequentialGroup()
                .addContainerGap(156, Short.MAX_VALUE)
                .addComponent(Volver)
                .addContainerGap())
        );

        VolverRanking.setText("Volver");
        VolverRanking.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                VolverRankingActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel5.setText("Puntuacion");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel6.setText("Ranking");

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel7.setText("Usuario");

        usuario1.setText("usuario1");

        usuario2.setText("usuario2");

        usuario3.setText("usuario3");

        usuario4.setText("usuario4");

        usuario5.setText("usuario5");

        usuario6.setText("usuario6");

        usuario7.setText("usuario7");

        usuario8.setText("usuario8");

        usuario9.setText("usuario9");

        usuario10.setText("usuario10");

        punt1.setText("punt1");

        punt2.setText("punt2");

        punt3.setText("punt3");

        punt4.setText("punt4");

        punt5.setText("punt5");

        punt6.setText("punt6");

        punt7.setText("punt7");

        punt8.setText("punt8");

        punt9.setText("punt9");

        punt10.setText("punt10");

        norank.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        norank.setText("No hay puntuaciones a mostrar");

        javax.swing.GroupLayout RankingGuiLayout = new javax.swing.GroupLayout(RankingGui);
        RankingGui.setLayout(RankingGuiLayout);
        RankingGuiLayout.setHorizontalGroup(
            RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, RankingGuiLayout.createSequentialGroup()
                .addContainerGap(550, Short.MAX_VALUE)
                .addComponent(VolverRanking)
                .addContainerGap())
            .addGroup(RankingGuiLayout.createSequentialGroup()
                .addGap(234, 234, 234)
                .addComponent(jLabel6)
                .addContainerGap(262, Short.MAX_VALUE))
            .addGroup(RankingGuiLayout.createSequentialGroup()
                .addGap(180, 180, 180)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(RankingGuiLayout.createSequentialGroup()
                        .addComponent(norank)
                        .addContainerGap())
                    .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(RankingGuiLayout.createSequentialGroup()
                            .addComponent(usuario10)
                            .addContainerGap())
                        .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(RankingGuiLayout.createSequentialGroup()
                                .addComponent(usuario9)
                                .addContainerGap())
                            .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(RankingGuiLayout.createSequentialGroup()
                                    .addComponent(usuario8)
                                    .addContainerGap())
                                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(RankingGuiLayout.createSequentialGroup()
                                        .addComponent(usuario7)
                                        .addContainerGap())
                                    .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(RankingGuiLayout.createSequentialGroup()
                                            .addComponent(usuario6)
                                            .addContainerGap())
                                        .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(RankingGuiLayout.createSequentialGroup()
                                                .addComponent(usuario5)
                                                .addContainerGap())
                                            .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(RankingGuiLayout.createSequentialGroup()
                                                    .addComponent(usuario4)
                                                    .addContainerGap())
                                                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(RankingGuiLayout.createSequentialGroup()
                                                        .addComponent(usuario2)
                                                        .addContainerGap())
                                                    .addGroup(RankingGuiLayout.createSequentialGroup()
                                                        .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jLabel7)
                                                            .addComponent(usuario1)
                                                            .addComponent(usuario3))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 144, Short.MAX_VALUE)
                                                        .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(punt3)
                                                            .addComponent(punt1)
                                                            .addComponent(jLabel5)
                                                            .addComponent(punt2)
                                                            .addComponent(punt4)
                                                            .addComponent(punt5)
                                                            .addComponent(punt6)
                                                            .addComponent(punt7)
                                                            .addComponent(punt8)
                                                            .addComponent(punt9)
                                                            .addComponent(punt10))
                                                        .addGap(185, 185, 185))))))))))))
        );
        RankingGuiLayout.setVerticalGroup(
            RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(RankingGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addGap(18, 18, 18)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel5))
                .addGap(18, 18, 18)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario1)
                    .addComponent(punt1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario2)
                    .addComponent(punt2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario3)
                    .addComponent(punt3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario4)
                    .addComponent(punt4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario5)
                    .addComponent(punt5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario6)
                    .addComponent(punt6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario7)
                    .addComponent(punt7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario8)
                    .addComponent(punt8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario9)
                    .addComponent(punt9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(RankingGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuario10)
                    .addComponent(punt10))
                .addGap(18, 18, 18)
                .addComponent(norank)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(VolverRanking)
                .addContainerGap())
        );

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("Selección de jugadores");

        jLabel9.setText("Número de jugadores");

        NJug.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NJugActionPerformed(evt);
            }
        });

        aceptarJugadores.setText("Aceptar");
        aceptarJugadores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarJugadoresActionPerformed(evt);
            }
        });

        jug1.setText("Jugador 1");

        jug11.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug11ActionPerformed(evt);
            }
        });

        jug12.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        jug5.setText("Jugador 5");

        jug51.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug51.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug51ActionPerformed(evt);
            }
        });

        jug52.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        jug2.setText("Jugador 2");

        jug21.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug21ActionPerformed(evt);
            }
        });

        jug22.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        jug6.setText("Jugador 6");

        jug61.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug61.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug61ActionPerformed(evt);
            }
        });

        jug62.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        jug3.setText("Jugador 3");

        jug31.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug31.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug31ActionPerformed(evt);
            }
        });

        jug32.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        jug7.setText("Jugador 7");

        jug71.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug71.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug71ActionPerformed(evt);
            }
        });

        jug72.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        jug4.setText("Jugador 4");

        jug41.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Humano", "Máquina", "Invitado" }));
        jug41.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jug41ActionPerformed(evt);
            }
        });

        jug42.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Facil", "Medio", "Dificil" }));

        javax.swing.GroupLayout SelJugGuiLayout = new javax.swing.GroupLayout(SelJugGui);
        SelJugGui.setLayout(SelJugGuiLayout);
        SelJugGuiLayout.setHorizontalGroup(
            SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SelJugGuiLayout.createSequentialGroup()
                .addContainerGap(542, Short.MAX_VALUE)
                .addComponent(aceptarJugadores)
                .addContainerGap())
            .addGroup(SelJugGuiLayout.createSequentialGroup()
                .addGap(173, 173, 173)
                .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(NJug, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel8)
                    .addGroup(SelJugGuiLayout.createSequentialGroup()
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug1))
                        .addGap(18, 18, 18)
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug2))
                        .addGap(18, 18, 18)
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug3))
                        .addGap(18, 18, 18)
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug42, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug41, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug4)))
                    .addGroup(SelJugGuiLayout.createSequentialGroup()
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug52, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug5))
                        .addGap(18, 18, 18)
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug62, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug61, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug6))
                        .addGap(18, 18, 18)
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jug72, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug71, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jug7))))
                .addContainerGap(84, Short.MAX_VALUE))
        );
        SelJugGuiLayout.setVerticalGroup(
            SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SelJugGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(SelJugGuiLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(SelJugGuiLayout.createSequentialGroup()
                                .addComponent(NJug, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(25, 25, 25)
                                .addComponent(jug1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jug11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jug12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(SelJugGuiLayout.createSequentialGroup()
                                .addComponent(jug2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jug21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jug22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(SelJugGuiLayout.createSequentialGroup()
                        .addComponent(jug3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jug31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jug32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(SelJugGuiLayout.createSequentialGroup()
                        .addComponent(jug4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jug41, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jug42, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(SelJugGuiLayout.createSequentialGroup()
                        .addComponent(jug5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jug51, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jug52, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
                        .addComponent(aceptarJugadores))
                    .addGroup(SelJugGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(SelJugGuiLayout.createSequentialGroup()
                            .addComponent(jug7)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jug71, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jug72, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(SelJugGuiLayout.createSequentialGroup()
                            .addComponent(jug6)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jug61, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jug62, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jLabel18.setText("Esta pantalla será específica para cada grupo, en la documentación está la marena de usar el numero y tipo de jugadores");

        jButton1.setText("Inicio");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout PartidaGuiLayout = new javax.swing.GroupLayout(PartidaGui);
        PartidaGui.setLayout(PartidaGuiLayout);
        PartidaGuiLayout.setHorizontalGroup(
            PartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PartidaGuiLayout.createSequentialGroup()
                .addGroup(PartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PartidaGuiLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel18))
                    .addGroup(PartidaGuiLayout.createSequentialGroup()
                        .addGap(242, 242, 242)
                        .addComponent(jButton1)))
                .addContainerGap(31, Short.MAX_VALUE))
        );
        PartidaGuiLayout.setVerticalGroup(
            PartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PartidaGuiLayout.createSequentialGroup()
                .addGap(61, 61, 61)
                .addComponent(jLabel18)
                .addGap(127, 127, 127)
                .addComponent(jButton1)
                .addContainerGap(194, Short.MAX_VALUE))
        );

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel10.setText("Alta de nuevo usuario");

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel11.setText("Nombre de usuario");

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel12.setText("Contraseña");

        existente.setFont(new java.awt.Font("Tahoma", 0, 14));
        existente.setText("Nombre de usuario ya existente!");

        aceptaralta.setText("Aceptar");
        aceptaralta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptaraltaActionPerformed(evt);
            }
        });

        Cancelaralta.setText("Cancelar");
        Cancelaralta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelaraltaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout RegistrarGuiLayout = new javax.swing.GroupLayout(RegistrarGui);
        RegistrarGui.setLayout(RegistrarGuiLayout);
        RegistrarGuiLayout.setHorizontalGroup(
            RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(RegistrarGuiLayout.createSequentialGroup()
                .addGap(177, 177, 177)
                .addGroup(RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, RegistrarGuiLayout.createSequentialGroup()
                        .addGroup(RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(nombreusuarionuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 119, Short.MAX_VALUE)
                        .addGroup(RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addComponent(contraseñausuarionuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(100, Short.MAX_VALUE))
            .addGroup(RegistrarGuiLayout.createSequentialGroup()
                .addGap(238, 238, 238)
                .addComponent(existente)
                .addContainerGap(187, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, RegistrarGuiLayout.createSequentialGroup()
                .addContainerGap(449, Short.MAX_VALUE)
                .addComponent(Cancelaralta)
                .addGap(18, 18, 18)
                .addComponent(aceptaralta)
                .addContainerGap())
        );
        RegistrarGuiLayout.setVerticalGroup(
            RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(RegistrarGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel10)
                .addGap(18, 18, 18)
                .addGroup(RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12))
                .addGap(18, 18, 18)
                .addGroup(RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nombreusuarionuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(contraseñausuarionuevo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(40, 40, 40)
                .addComponent(existente)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 200, Short.MAX_VALUE)
                .addGroup(RegistrarGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptaralta)
                    .addComponent(Cancelaralta))
                .addContainerGap())
        );

        UsuarioGui.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                UsuarioGuiComponentShown(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel13.setText("Usuario");

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel14.setText("Usuario:");

        Usuarionombre.setEditable(false);

        jtext.setFont(new java.awt.Font("Tahoma", 0, 14));
        jtext.setText("Contraseña actual:");

        Usuariocontraseña.setEditable(false);

        Usuarioaceptar.setText("Aceptar");
        Usuarioaceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UsuarioaceptarActionPerformed(evt);
            }
        });

        Uauariocancelar.setText("Cancelar");
        Uauariocancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UauariocancelarActionPerformed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel15.setText("Contraseña nueva:");

        javax.swing.GroupLayout UsuarioGuiLayout = new javax.swing.GroupLayout(UsuarioGui);
        UsuarioGui.setLayout(UsuarioGuiLayout);
        UsuarioGuiLayout.setHorizontalGroup(
            UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(UsuarioGuiLayout.createSequentialGroup()
                .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(UsuarioGuiLayout.createSequentialGroup()
                        .addGap(201, 201, 201)
                        .addComponent(jLabel13))
                    .addGroup(UsuarioGuiLayout.createSequentialGroup()
                        .addGap(37, 37, 37)
                        .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtext)
                            .addComponent(jLabel14)
                            .addComponent(jLabel15))
                        .addGap(18, 18, 18)
                        .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(Usuariocontraseñanueva)
                            .addComponent(Usuariocontraseña)
                            .addComponent(Usuarionombre, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))))
                .addContainerGap(302, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, UsuarioGuiLayout.createSequentialGroup()
                .addContainerGap(449, Short.MAX_VALUE)
                .addComponent(Uauariocancelar)
                .addGap(18, 18, 18)
                .addComponent(Usuarioaceptar)
                .addContainerGap())
        );
        UsuarioGuiLayout.setVerticalGroup(
            UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(UsuarioGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel13)
                .addGap(73, 73, 73)
                .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(Usuarionombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtext)
                    .addComponent(Usuariocontraseña, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(Usuariocontraseñanueva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 161, Short.MAX_VALUE)
                .addGroup(UsuarioGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Usuarioaceptar)
                    .addComponent(Uauariocancelar))
                .addContainerGap())
        );

        jLabel16.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel16.setText("Cargar partida");

        jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel17.setText("<html>Selecciona la partida a cargar en el siguiente menú desplegable. <br>\nTen en cuenta que para cargar una partida todos los jugadores de esa partida tendran que introducir su nombre de usuario y contraseña.");

        cargaraceptar.setText("Aceptar");
        cargaraceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cargaraceptarActionPerformed(evt);
            }
        });

        cargarcancelar.setText("Cancelar");
        cargarcancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cargarcancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout CargarPartidaGuiLayout = new javax.swing.GroupLayout(CargarPartidaGui);
        CargarPartidaGui.setLayout(CargarPartidaGuiLayout);
        CargarPartidaGuiLayout.setHorizontalGroup(
            CargarPartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CargarPartidaGuiLayout.createSequentialGroup()
                .addGroup(CargarPartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CargarPartidaGuiLayout.createSequentialGroup()
                        .addGap(168, 168, 168)
                        .addComponent(jLabel16))
                    .addGroup(CargarPartidaGuiLayout.createSequentialGroup()
                        .addGap(87, 87, 87)
                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(CargarPartidaGuiLayout.createSequentialGroup()
                        .addGap(176, 176, 176)
                        .addComponent(partidaacargar, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(92, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CargarPartidaGuiLayout.createSequentialGroup()
                .addContainerGap(449, Short.MAX_VALUE)
                .addComponent(cargarcancelar)
                .addGap(18, 18, 18)
                .addComponent(cargaraceptar)
                .addContainerGap())
        );
        CargarPartidaGuiLayout.setVerticalGroup(
            CargarPartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CargarPartidaGuiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel16)
                .addGap(45, 45, 45)
                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(73, 73, 73)
                .addComponent(partidaacargar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 134, Short.MAX_VALUE)
                .addGroup(CargarPartidaGuiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cargaraceptar)
                    .addComponent(cargarcancelar))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 643, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(IntroGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 131, Short.MAX_VALUE)
                    .addComponent(AyudaGui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 132, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 93, Short.MAX_VALUE)
                    .addComponent(LoginGui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 93, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(RankingGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(SelJugGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(PartidaGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(RegistrarGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(UsuarioGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(CargarPartidaGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 441, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(IntroGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 125, Short.MAX_VALUE)
                    .addComponent(AyudaGui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 126, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 84, Short.MAX_VALUE)
                    .addComponent(LoginGui, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 84, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(RankingGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(SelJugGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(PartidaGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(RegistrarGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(UsuarioGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(CargarPartidaGui, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    protected void NuevaPartidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NuevaPartidaActionPerformed
        // TODO add your handling code here:
        for (int i = 1; i < nmaxjug; i++) {
            NJug.addItem(Integer.toString(i + 1));
        }
        IntroGui.setVisible(false);
        SelJugGui.setVisible(true);
        getRootPane().setContentPane(SelJugGui);
        VISIBLE(1);
    }//GEN-LAST:event_NuevaPartidaActionPerformed

    protected void AyudaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AyudaActionPerformed
        // TODO add your handling code here:
        IntroGui.setVisible(false);
        AyudaGui.setVisible(true);
        getRootPane().setContentPane(AyudaGui);
    }//GEN-LAST:event_AyudaActionPerformed

    protected void VolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VolverActionPerformed
        // TODO add your handling code here:
        AyudaGui.setVisible(false);
        IntroGui.setVisible(true);
        getRootPane().setContentPane(IntroGui);
    }//GEN-LAST:event_VolverActionPerformed

    protected void aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarActionPerformed
        // TODO add your handling code here:
        try {
            if (ControladorUsuario.validarLogin(user.getText(), pass.getText())) {
                Humano u = new Humano();
                u = (Humano) GestorUsuarios.carregarUsuari(user.getText(), pass.getText());
                Usuarionombre.setText(u.getLogin());
                Usuariocontraseña.setText(u.getPassword());
                Usuariocontraseñanueva.setText(u.getPassword());
                LoginGui.setVisible(false);
                nextpane.setVisible(true);
                getRootPane().setContentPane(nextpane);
                usuarioactual = u;
            } else {
                incorrecto.setVisible(true);
            }
        } catch (UsuariInexistent e) {
            incorrecto.setVisible(true);
        }
    }//GEN-LAST:event_aceptarActionPerformed

    protected void RankingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RankingActionPerformed
        // TODO add your handling code here:
        norank.setVisible(false);
        IntroGui.setVisible(false);
        RankingGui.setVisible(true);
        getRootPane().setContentPane(RankingGui);
        Ranking[] j;
        j = ControladorRanking.mostrarRanking();
        if (j.length >= 1){
            usuario1.setText(j[0].getLogin());
            punt1.setText(Integer.toString(j[0].getMediana()));
            usuario1.setVisible(true);
            punt1.setVisible(true);
        }
        else {
            usuario1.setVisible(false);
            punt1.setVisible(false);
            norank.setVisible(true);
        }
        if (j.length >= 2){
            usuario2.setText(j[1].getLogin());
            punt2.setText(Integer.toString(j[1].getMediana()));
            usuario2.setVisible(true);
            punt2.setVisible(true);
        }
        else {
            usuario2.setVisible(false);
            punt2.setVisible(false);
        }
        if (j.length >= 3){
            usuario3.setText(j[2].getLogin());
            punt3.setText(Integer.toString(j[2].getMediana()));
            usuario3.setVisible(true);
            punt3.setVisible(true);
        }
        else {
            usuario3.setVisible(false);
            punt3.setVisible(false);
        }
        if (j.length >= 4){
            usuario4.setText(j[3].getLogin());
            punt4.setText(Integer.toString(j[3].getMediana()));
            usuario4.setVisible(true);
            punt4.setVisible(true);
        }
        else {
            usuario4.setVisible(false);
            punt4.setVisible(false);
        }
        if (j.length >= 5){
            usuario5.setText(j[4].getLogin());
            punt5.setText(Integer.toString(j[4].getMediana()));
            usuario5.setVisible(true);
            punt5.setVisible(true);
        }
        else {
            usuario5.setVisible(false);
            punt5.setVisible(false);
        }
        if (j.length >= 6){
            usuario6.setText(j[5].getLogin());
            punt6.setText(Integer.toString(j[5].getMediana()));
            usuario6.setVisible(true);
            punt6.setVisible(true);
        }
        else {
            usuario6.setVisible(false);
            punt6.setVisible(false);
        }if (j.length >= 7){
            usuario7.setText(j[6].getLogin());
            punt7.setText(Integer.toString(j[6].getMediana()));
            usuario7.setVisible(true);
            punt7.setVisible(true);
        }
        else {
            usuario7.setVisible(false);
            punt7.setVisible(false);
        }
        if (j.length >= 8){
            usuario8.setText(j[7].getLogin());
            punt8.setText(Integer.toString(j[7].getMediana()));
            usuario8.setVisible(true);
            punt8.setVisible(true);
        }
        else {
            usuario8.setVisible(false);
            punt8.setVisible(false);
        }
        if (j.length >= 9){
            usuario9.setText(j[8].getLogin());
            punt9.setText(Integer.toString(j[8].getMediana()));
            usuario9.setVisible(true);
            punt9.setVisible(true);
        }
        else {
            usuario9.setVisible(false);
            punt9.setVisible(false);
        }
        if (j.length >= 10){
            usuario10.setText(j[9].getLogin());
            punt10.setText(Integer.toString(j[9].getMediana()));
            usuario10.setVisible(true);
            punt10.setVisible(true);
        }
        else {
            usuario10.setVisible(false);
            punt10.setVisible(false);
        }
    }//GEN-LAST:event_RankingActionPerformed

    protected void VolverRankingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VolverRankingActionPerformed
        // TODO add your handling code here:
        IntroGui.setVisible(true);
        RankingGui.setVisible(false);
        getRootPane().setContentPane(IntroGui);
    }//GEN-LAST:event_VolverRankingActionPerformed

    protected void NJugActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NJugActionPerformed
        // TODO add your handling code here:
        VISIBLE(0);
        int n = NJug.getSelectedIndex();
        n += 2;
        if (n == 7) {
        } else if (n <= 6) {
            jug7.setVisible(false);
            jug71.setVisible(false);
            jug72.setVisible(false);
            if (n <= 5) {
                jug6.setVisible(false);
                jug61.setVisible(false);
                jug62.setVisible(false);
                if (n <= 4) {
                    jug5.setVisible(false);
                    jug51.setVisible(false);
                    jug52.setVisible(false);
                    if (n <= 3) {
                        jug4.setVisible(false);
                        jug41.setVisible(false);
                        jug42.setVisible(false);
                        if (n <= 2) {
                            jug3.setVisible(false);
                            jug31.setVisible(false);
                            jug32.setVisible(false);
                        }
                    }
                }
            }
        }

    }//GEN-LAST:event_NJugActionPerformed

    protected void jug11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug11ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug11.getSelectedItem() == "Humano" || jug11.getSelectedItem() == "Invitado") {
            jug12.setVisible(false);
        } else {
            jug12.setVisible(true);
        }
    }//GEN-LAST:event_jug11ActionPerformed

    protected void jug21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug21ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug21.getSelectedItem() == "Humano" || jug21.getSelectedItem() == "Invitado") {
            jug22.setVisible(false);
        } else {
            jug22.setVisible(true);
        }
    }//GEN-LAST:event_jug21ActionPerformed

    protected void jug31ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug31ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug31.getSelectedItem() == "Humano" || jug31.getSelectedItem() == "Invitado") {
            jug32.setVisible(false);
        } else {
            jug32.setVisible(true);
        }
    }//GEN-LAST:event_jug31ActionPerformed

    protected void jug41ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug41ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug41.getSelectedItem() == "Humano" || jug41.getSelectedItem() == "Invitado") {
            jug42.setVisible(false);
        } else {
            jug42.setVisible(true);
        }
    }//GEN-LAST:event_jug41ActionPerformed

    protected void jug51ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug51ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug51.getSelectedItem() == "Humano" || jug51.getSelectedItem() == "Invitado") {
            jug52.setVisible(false);
        } else {
            jug52.setVisible(true);
        }
    }//GEN-LAST:event_jug51ActionPerformed

    protected void jug61ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug61ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug61.getSelectedItem() == "Humano" || jug61.getSelectedItem() == "Invitado") {
            jug62.setVisible(false);
        } else {
            jug62.setVisible(true);
        }
    }//GEN-LAST:event_jug61ActionPerformed

    protected void jug71ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jug71ActionPerformed
        // TODO add your handling code here:
        int n = NJug.getSelectedIndex();
        if (jug71.getSelectedItem() == "Humano" || jug71.getSelectedItem() == "Invitado") {
            jug72.setVisible(false);
        } else {
            jug72.setVisible(true);
        }
    }//GEN-LAST:event_jug71ActionPerformed

    protected void aceptarJugadoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarJugadoresActionPerformed
         // TODO add your handling code here:
        SelJugGui.setVisible(false);
        PartidaGui.setVisible(true);
        getRootPane().setContentPane(PartidaGui);
        /*
         *Tenemos que mirar la cantidad de jugadores que se ha escojido, inicializarlos
         * y para cada uno que sea humano lanzar la pantalla de LoginGui, para
         * las maquinas inicializarlas con el nivel indicado, y entonces iniciar
         * una partida con todos esos datos
         */
    }//GEN-LAST:event_aceptarJugadoresActionPerformed

    protected void RegistrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RegistrarActionPerformed
        // TODO add your handling code here:
        IntroGui.setVisible(false);
        RegistrarGui.setVisible(true);
        getRootPane().setContentPane(RegistrarGui);
        existente.setVisible(false);
        nextpanereg = IntroGui;
        previouspanereg = IntroGui;
    }//GEN-LAST:event_RegistrarActionPerformed

    protected void aceptaraltaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptaraltaActionPerformed
        // TODO add your handling code here:
        try {
            ControladorUsuario.altaUser(nombreusuarionuevo.getText(), contraseñausuarionuevo.getText(), null);
            RegistrarGui.setVisible(false);
            nextpanereg.setVisible(true);
            getRootPane().setContentPane(nextpanereg);

            Usuarionombre.setText(nombreusuarionuevo.getText());
            Usuariocontraseña.setText(contraseñausuarionuevo.getText());
            Usuariocontraseñanueva.setText(contraseñausuarionuevo.getText());
            nombreusuarionuevo.setText("");
            contraseñausuarionuevo.setText("");
        } catch (CaracteresInvalidos e) {
            existente.setVisible(true);
        } catch (UsuariExistent e) {
            existente.setVisible(true);
        }
    }//GEN-LAST:event_aceptaraltaActionPerformed

    protected void CancelaraltaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelaraltaActionPerformed
        // TODO add your handling code here:
        RegistrarGui.setVisible(false);
        previouspanereg.setVisible(true);
        getRootPane().setContentPane(previouspanereg);
        nombreusuarionuevo.setText("");
        contraseñausuarionuevo.setText("");
        incorrecto.setVisible(false);
        existente.setVisible(false);
    }//GEN-LAST:event_CancelaraltaActionPerformed

    protected void UsuarioaceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UsuarioaceptarActionPerformed
        // TODO add your handling code here:
        try {
            ControladorUsuario.modificarPass(Usuarionombre.getText(), Usuariocontraseña.getText(), Usuariocontraseñanueva.getText());
        } catch (UsuariInexistent e) {
        } catch (CaracteresInvalidos e) {
        }
        UsuarioGui.setVisible(false);
        IntroGui.setVisible(true);
        getRootPane().setContentPane(IntroGui);
        Usuariocontraseñanueva.setText("");
    }//GEN-LAST:event_UsuarioaceptarActionPerformed

    protected void UauariocancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UauariocancelarActionPerformed
        // TODO add your handling code here:
        UsuarioGui.setVisible(false);
        IntroGui.setVisible(true);
        getRootPane().setContentPane(IntroGui);
    }//GEN-LAST:event_UauariocancelarActionPerformed

    protected void UsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UsuarioActionPerformed
        // TODO add your handling code here:
        IntroGui.setVisible(false);
        LoginGui.setVisible(true);
        getRootPane().setContentPane(LoginGui);
        nextpane = UsuarioGui;
        previouspane = IntroGui;
        incorrecto.setVisible(false);
        user.setText("");
        pass.setText("");
    }//GEN-LAST:event_UsuarioActionPerformed

    protected void cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelarActionPerformed
        // TODO add your handling code here:
        LoginGui.setVisible(false);
        previouspane.setVisible(true);
        getRootPane().setContentPane(previouspane);
        user.setText("");
        pass.setText("");
    }//GEN-LAST:event_cancelarActionPerformed

    protected void UsuarioGuiComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_UsuarioGuiComponentShown
        // TODO add your handling code here:
        Usuarionombre.setText(user.getText());
        Usuariocontraseña.setText(pass.getText());
    }//GEN-LAST:event_UsuarioGuiComponentShown

    protected void registrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_registrarActionPerformed
        // TODO add your handling code here:
        LoginGui.setVisible(false);
        RegistrarGui.setVisible(true);
        getRootPane().setContentPane(RegistrarGui);
        nextpanereg = nextpane;
        previouspanereg = LoginGui;
        existente.setVisible(false);

    }//GEN-LAST:event_registrarActionPerformed

    protected void CargarPartidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CargarPartidaActionPerformed
        // TODO add your handling code here:
        LoginGui.setVisible(false);
        CargarPartidaGui.setVisible(true);
        getRootPane().setContentPane(CargarPartidaGui);
        boolean err;
        String[] parts=new String[0];
        int partssize = 0;
        try {
            parts = Datos.GestorDiscoPartida.GetPartidas();
            err=true;
            cargaraceptar.setEnabled(true);
        } catch (Datos.DiscoException e) {
            err=false;
            cargaraceptar.setEnabled(false);
        }
        if (!err){
            partssize = parts.length;
        }
        for (int i = 0; i < partssize; i++) {
            partidaacargar.addItem(Integer.toString(i + 1));
        }
    }//GEN-LAST:event_CargarPartidaActionPerformed

    protected void cargarcancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cargarcancelarActionPerformed
        // TODO add your handling code here:
        CargarPartidaGui.setVisible(false);
        IntroGui.setVisible(true);
        getRootPane().setContentPane(IntroGui);
    }//GEN-LAST:event_cargarcancelarActionPerformed

    protected void cargaraceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cargaraceptarActionPerformed
        // TODO add your handling code here:
        if (partidaacargar.getSelectedItem() == null) {
            //CtrlPartidaRemigio.CargarPartida((String)partidaacargar.getSelectedItem());
        }
        else {
            CargarPartidaGui.setVisible(false);
            IntroGui.setVisible(true);
            getRootPane().setContentPane(IntroGui);
        }

    }//GEN-LAST:event_cargaraceptarActionPerformed

    protected void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        PartidaGui.setVisible(false);
        IntroGui.setVisible(true);
        getRootPane().setContentPane(IntroGui);
    }//GEN-LAST:event_jButton1ActionPerformed
    protected void VISIBLE(int i) {
        if (i == 0) {
            jug7.setVisible(true);
            jug71.setVisible(true);
            jug6.setVisible(true);
            jug61.setVisible(true);
            jug5.setVisible(true);
            jug51.setVisible(true);
            jug4.setVisible(true);
            jug41.setVisible(true);
            jug3.setVisible(true);
            jug31.setVisible(true);
        }
        if (i == 1) {
            jug7.setVisible(false);
            jug71.setVisible(false);
            jug6.setVisible(false);
            jug61.setVisible(false);
            jug5.setVisible(false);
            jug51.setVisible(false);
            jug4.setVisible(false);
            jug41.setVisible(false);
            jug3.setVisible(false);
            jug31.setVisible(false);
            jug72.setVisible(false);
            jug62.setVisible(false);
            jug52.setVisible(false);
            jug42.setVisible(false);
            jug32.setVisible(false);
            jug22.setVisible(false);
            jug12.setVisible(false);
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new gui().setVisible(true);
                nextpane = IntroGui;
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    protected javax.swing.JButton Ayuda;
    protected javax.swing.JPanel AyudaGui;
    protected javax.swing.JLabel Bienvenido;
    protected javax.swing.JButton Cancelaralta;
    protected javax.swing.JButton CargarPartida;
    protected javax.swing.JPanel CargarPartidaGui;
    protected static javax.swing.JPanel IntroGui;
    protected javax.swing.JLabel LabelAyuda;
    protected javax.swing.JPanel LoginGui;
    protected javax.swing.JComboBox NJug;
    protected javax.swing.JButton NuevaPartida;
    protected javax.swing.JPanel PartidaGui;
    protected javax.swing.JButton Ranking;
    protected javax.swing.JPanel RankingGui;
    protected javax.swing.JButton Registrar;
    protected javax.swing.JPanel RegistrarGui;
    protected javax.swing.JPanel SelJugGui;
    protected javax.swing.JButton Uauariocancelar;
    protected javax.swing.JButton Usuario;
    protected javax.swing.JPanel UsuarioGui;
    protected javax.swing.JButton Usuarioaceptar;
    protected javax.swing.JTextField Usuariocontraseña;
    protected javax.swing.JTextField Usuariocontraseñanueva;
    protected javax.swing.JTextField Usuarionombre;
    protected javax.swing.JButton Volver;
    protected javax.swing.JButton VolverRanking;
    protected javax.swing.JButton aceptar;
    protected javax.swing.JButton aceptarJugadores;
    protected javax.swing.JButton aceptaralta;
    protected javax.swing.JButton cancelar;
    protected javax.swing.JButton cargaraceptar;
    protected javax.swing.JButton cargarcancelar;
    protected javax.swing.JTextField contraseñausuarionuevo;
    protected javax.swing.JLabel existente;
    protected javax.swing.JLabel incorrecto;
    protected javax.swing.JButton jButton1;
    protected javax.swing.JLabel jLabel1;
    protected javax.swing.JLabel jLabel10;
    protected javax.swing.JLabel jLabel11;
    protected javax.swing.JLabel jLabel12;
    protected javax.swing.JLabel jLabel13;
    protected javax.swing.JLabel jLabel14;
    protected javax.swing.JLabel jLabel15;
    protected javax.swing.JLabel jLabel16;
    protected javax.swing.JLabel jLabel17;
    protected javax.swing.JLabel jLabel18;
    protected javax.swing.JLabel jLabel2;
    protected javax.swing.JLabel jLabel3;
    protected javax.swing.JLabel jLabel4;
    protected javax.swing.JLabel jLabel5;
    protected javax.swing.JLabel jLabel6;
    protected javax.swing.JLabel jLabel7;
    protected javax.swing.JLabel jLabel8;
    protected javax.swing.JLabel jLabel9;
    protected javax.swing.JSeparator jSeparator1;
    protected javax.swing.JLabel jtext;
    protected javax.swing.JLabel jug1;
    protected javax.swing.JComboBox jug11;
    protected javax.swing.JComboBox jug12;
    protected javax.swing.JLabel jug2;
    protected javax.swing.JComboBox jug21;
    protected javax.swing.JComboBox jug22;
    protected javax.swing.JLabel jug3;
    protected javax.swing.JComboBox jug31;
    protected javax.swing.JComboBox jug32;
    protected javax.swing.JLabel jug4;
    protected javax.swing.JComboBox jug41;
    protected javax.swing.JComboBox jug42;
    protected javax.swing.JLabel jug5;
    protected javax.swing.JComboBox jug51;
    protected javax.swing.JComboBox jug52;
    protected javax.swing.JLabel jug6;
    protected javax.swing.JComboBox jug61;
    protected javax.swing.JComboBox jug62;
    protected javax.swing.JLabel jug7;
    protected javax.swing.JComboBox jug71;
    protected javax.swing.JComboBox jug72;
    protected javax.swing.JTextField nombreusuarionuevo;
    protected javax.swing.JLabel norank;
    protected javax.swing.JComboBox partidaacargar;
    protected javax.swing.JTextField pass;
    protected javax.swing.JLabel punt1;
    protected javax.swing.JLabel punt10;
    protected javax.swing.JLabel punt2;
    protected javax.swing.JLabel punt3;
    protected javax.swing.JLabel punt4;
    protected javax.swing.JLabel punt5;
    protected javax.swing.JLabel punt6;
    protected javax.swing.JLabel punt7;
    protected javax.swing.JLabel punt8;
    protected javax.swing.JLabel punt9;
    protected javax.swing.JButton registrar;
    protected javax.swing.JTextField user;
    protected javax.swing.JLabel usuario1;
    protected javax.swing.JLabel usuario10;
    protected javax.swing.JLabel usuario2;
    protected javax.swing.JLabel usuario3;
    protected javax.swing.JLabel usuario4;
    protected javax.swing.JLabel usuario5;
    protected javax.swing.JLabel usuario6;
    protected javax.swing.JLabel usuario7;
    protected javax.swing.JLabel usuario8;
    protected javax.swing.JLabel usuario9;
    // End of variables declaration//GEN-END:variables
}
